<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdminPowerTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_power', function (Blueprint $table) {
            $table->increments('power_id');
            $table->string('power')->unique()->comment('权限');
            $table->string('power_name')->nullable()->comment('权限名');
            $table->string('content')->nullable()->comment('权限说明');
            $table->string('module')->nullable()->comment('模块');
            $table->string('module_name')->nullable()->comment('模块名');
            $table->string('controller')->nullable()->comment('所属控制器');
            $table->string('controller_name')->nullable()->comment('所属控制器');
            $table->string('action', 100)->nullable()->comment('控制器方法');
            $table->tinyInteger('is_check')->default(1)->comment('1需要检测，0不需要');
            $table->timestamps();
            $table->index('power');
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE admin_power AUTO_INCREMENT=100");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_power');
    }
}
